
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>管理员中心</title>
    <link rel="stylesheet" type="text/css" href="css/common.css"/>
    <link rel="stylesheet" type="text/css" href="css/main.css"/>
    <script type="text/javascript" src="js/libs/modernizr.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="ueditor.all.js"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<div class="topbar-wrap white">
    <!--<div class="topbar-inner clearfix">-->
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo none"><a href="index.html" class="navbar-brand">管理员中心</a></h1>
        </div>
    </div>
</div>
<div class="container clearfix">
    <div class="sidebar-wrap">
        <div class="sidebar-title">
            <h1>菜单</h1>
        </div>
        <div class="sidebar-content">
        
            <ul class="sidebar-list">
                <li>
                    <a href="#"><i class="icon-font">&#xe003;</i>常用操作</a>
                    <ul class="sub-menu">
                        <li><a href="administer-user.php"><i class="icon-font">&#xe008;</i>用户管理</a></li>
                        <li><a href="administer-userguest.php"><i class="icon-font">&#xe005;</i>留言管理</a></li>
                        <li><a href="administer-wenzhang.php"><i class="icon-font">&#xe006;</i>添加文章</a></li>
                    </ul>
                </li>
                <li>
                    <ul class="sub-menu">
                        <li><a href="administer-ManageArt.php"><i class="icon-font">&#xe017;</i>文章列表</a></li>
                        <li><a href="administer-Navigation.php"><i class="icon-font">&#xe037;</i>导航管理</a></li>
                        <li><a href="administer-PowerpointList.php"><i class="icon-font">&#xe046;</i>幻灯片管理</a></li>
                        <li><a href="administer-Picture.php"><i class="icon-font">&#xe045;</i>图片管理</a></li>
                        <li><a href="administer-company.php"><i class="icon-font">&#xe035;</i>渠道资格</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="index.html" color="#white">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">文章列表</span></div>
        </div>
        <?php
                            session_start();
                            header("Content-Type:text/html;charset=UTF-8");
                            if (isset($_SESSION['id'])) {
                                echo "欢迎".$_SESSION['name']."登录！";
                                echo "<a href='login.html?'logout=logout>注销</a>";
                                $username = $_COOKIE['name'];
                                $password = $_COOKIE['password'];
                                //echo $username,$password;
                                include "shuju.php";
                                $id = $_SESSION['id'];
                                $sql = "select * from user";
                                $db = new DB();
                                $res = $db->get($sql);
                            }else{
                                header("location:login.html");
                            }
                ?>
        <div class="result-wrap">
            <table class="insert-tab" width="100%">
            <form action="administer-ManageArt.php" method="post">
                <tr><td>文章类型：</td><td><select name="leibie">
            <option value="全部">全部</option>
            <option value="ERP">ERP</option>
            <option value="O2O">O2O</option>
            <option value="成功案例">成功案例</option>
            <option value="渠道招募">渠道招募</option>
            <option value="行业动态">行业动态</option>
            <option value="公司简介">公司简介</option>
            <option value="招纳贤士">招纳贤士</option>
            </select>&nbsp;&nbsp;<input type="submit" value="选择该类别" name="leixing" class='btn btn-primary btn6 mr10'></td><td></td><td></td><td></td><td></td><td></td></tr></form>
            <tr>
                <td>文章id</td>
                <td>标题</td>
                <td>类别</td>
                <td>添加日期</td>
                <td>修改日期</td>
                <td></td>
                <td></td>
            </tr>
                <?php 
                    $db = new DB();
                    if(isset($_POST['leixing'])){
                        $leibie = $_POST['leibie'];
                        if ($leibie == '全部') {
                            $sql = "select * from ue";
                        }else{
                    $sql = "select * from ue where leibie = '$leibie'";
                        }
                    }else{
                        $sql = "select * from ue";
                    }
                    
                    $res = $db->get($sql);
                    for ($i=1; $i <= count($res) ; $i++) { 
                        $id = $res[$i-1][0];
                        $title = $res[$i-1][1];
                        $cont = $res[$i-1][2];
                        $leibie = $res[$i-1][3];
                        $date = $res[$i-1][4];
                        $repl_date = $res[$i-1][5];
                ?>
                <form name="myform" id="myform" method="post" action="administer-UpdateManageArt.php">
                <?php 
                        echo "<tr>
                            <td>$id</td>
                            <td style='width:250px;'>$title</td>
                            <td>$leibie</td>
                            <td>$date</td>
                            <td>$repl_date</td>
                            <td><input type='submit' value='修改文章' name='submit' class='btn btn-primary btn6 mr10'></td>
                            <td><input type='submit' value='删除文章' name='submit2' class='btn btn-danger btn6 mr10'></td>
                            <input type='hidden' value='$id' name='id'>
                            <input type='hidden' value='$title' name='title'>
                            <input type='hidden' value='$leibie' name='leibie'>
                            <input type='hidden' value='$date' name='date'>
                            <input type='hidden' value='$cont' name='cont'>
                            </tr>";
                ?>
                </form>
                <?php
                    }
                    ?>
            </table>
         </div>
    <!--/main-->
</div>
</body>
</html>